import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
import { BrowserRouter, Route, Routes} from 'react-router-dom';
import ItemInformation from './pages/ItemInformation';
import BasicUsage  from './pages/BasicUsage';
import BasicUsageCC from './pages/BasicUsageCC';
import RouterTest from './pages/RouterTest';
import MyRoutes from './routes';

const MyComponent = BasicUsage;
//Methods A
ReactDOM.render(
  <React.StrictMode>
    <BrowserRouter>
      <Routes>
        <Route path="/" element={<App />}></Route>

        <Route path="/BasicUsage"  element={<BasicUsage name="Leon" age={10} />} />
        <Route path="/BasicUsageCC"  element={<BasicUsageCC name="Leon" age={10} />} />

        <Route path="/ItemInformation"  element={<ItemInformation />} />
        <Route path="/RouterTest/:category/:id"  element={<RouterTest />} />
        <Route path="*"  element={<div>Page not found 404.</div>} />
      </Routes>
    </BrowserRouter>
  </React.StrictMode>,
  document.getElementById('root')
);

//Methods B

// ReactDOM.render(
//   <React.StrictMode>
//     <BrowserRouter>
//       <MyRoutes></MyRoutes>
//     </BrowserRouter>
//   </React.StrictMode>,
//   document.getElementById('root')
// );


// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
